package com.example.springbootshiro.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.springbootshiro.pojo.UserRole;
import com.example.springbootshiro.mapper.UserRoleMapper;
import com.example.springbootshiro.service.IUserRoleService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author gqz
 * @since 2021-09-03
 */
@Service
public class UserRoleServiceImpl extends ServiceImpl<UserRoleMapper, UserRole> implements IUserRoleService {

    @Autowired
    private UserRoleMapper userRoleMapper;

    @Override
    public List<UserRole> findRoleByUserId(Long id) {
        return userRoleMapper.selectList(new QueryWrapper<UserRole>().eq("user_id",id));
    }
}
